<?php

class NguoiDungBaiVietController extends BaseController {

    public function getIndex() {
        $bai_viet_model = new Bai_viet();
        $bai_viet = $bai_viet_model->get_dsbaiviet_limit();
        return View::make('index')->with('bai_viet', $bai_viet);
    }

    public function getPosts($id) {
        $bai_viet = DB::table('bai_viets')->where('id', '=', $id)->get();
        return View::make('nguoidungbaiviet.baiviet')->with('bai_viet', $bai_viet);
    }

    public function getPostcategory($id) {
        $bai_viet = DB::table('bai_viets')->where('ChuyenMucBaiViet_Id', '=', $id)->orderBy('thu_tu_bai_viet', 'desc')->get();
        return View::make('nguoidungbaiviet.baiviettheotheloai')->with('bai_viet', $bai_viet);
    }

}
